package com.campus.mapper;


import com.campus.entity.Activity;
import org.apache.ibatis.annotations.*;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper

public interface ActivityMapper {
    @Insert("insert into t_manager_activity(name, category, title, creator, abstract, " +
            "detailed_desc, status, created_time, archived_time, pic_urls, start_time, end_time)" +
            " values(#{name},#{category},#{title},#{creator},#{abstract1}," +
            "#{detailedDesc},#{status},#{createdTime},#{archivedTime},#{picUrls},#{startTime},#{endTime})")
    int insertActivity(Activity activity);
    void updateActivity(Activity activity);
    @Update("update t_manager_activity set status=#{status} where id =#{id}")
    void updateActivityStatus(int status,int id);

    List<Activity> selectActivityByCreateTime(@Param("status") Integer status, @Param("name") String name);
}
